<?php
$categoria	= $_GET["categoria"];
$dadosn1	= $_cat->pega($categoria);
?>

<style type="text/css">
/* category menu */
div#adv_categories {}
div#adv_categories ul {position: relative;background:none;border:none;}
div#adv_categories ul li {border:none; font-size:12px; text-shadow:0 1px 0 #FFFFFF; }
div#adv_categories ul li a  { display:inline; }
div#adv_categories ul li a:hover  { background: #f4f4f4;}
div#adv_categories li.maincat a { }
div#adv_categories li.maincat a:hover { }
div#adv_categories .catcol { float:left; padding:0 20px 0 0px; width:210px; border-left:1px dotted #bdbdbd; vertical-align:top;margin-top:6px; }
div#adv_categories .catcol ul { padding:0px; list-style:none;}
div#adv_categories .catcol ul li { float:none; margin:0px; padding:0px;}
div#adv_categories .catcol ul li a { margin:0; padding:2px 0; color:#545454; text-decoration:none;}
div#adv_categories .catcol ul li.maincat { width:97.5%; background: url(images/gray-grad.png) repeat-x scroll left top #DFDFDF; text-transform:uppercase; font-weight:bold; color:#545454; float:none; margin:0; padding:5px 10px;background-color:#e3e3e3; -khtml-border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px;}
div#adv_categories .catcol ul li.maincat a {}
div#adv_categories .catcol ul li.maincat a:hover {background:none; text-decoration:underline !important;}
div#adv_categories .catcol ul li.cat-item { width:100%; background:transparent url(images/bullet-grey.png) no-repeat scroll 7px 11px; line-height:10px; padding:5px 0 5px 15px; font-size:12px; }
div#adv_categories .catcol ul li.cat-item:hover {background-color:#f4f4f4;background-image:none;-khtml-border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px;}
div#adv_categories .catcol ul li.cat-item a:hover { text-decoration:underline !important;background-color:#f4f4f4;}
div#adv_categories .first { border-left:none;}

#somelista{ display:none}

#categoriaspai { width:914px; background: url(images/gray-grad.png) repeat-x scroll left top #DFDFDF; color:#545454; padding:5px; background-color:#e3e3e3; -khtml-border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; height:130px}

#categoriaspai ul{ list-style:none; padding:5px; margin:0px}
#categoriaspai ul li a { margin:0px; padding:2px 0; color:#545454; text-decoration:none;}

#categoriaspai ul li.menu_cat{ width:170px; background:transparent url(images/bullet-grey.png) no-repeat scroll 7px 11px; padding:2px; font-size:12px; float:left;  }


</style>


<div id="categoriaspai">
	<ul>
  <?php 
  $dadoscatesq	= $_cat->lista(false,false,"ORDER BY titulo");
  
  foreach($dadoscatesq as $cat){
  
  ?>

  <li class="menu_cat"><a href="categoria.php?categoria=<?php echo $cat["id"]; ?>"><?php echo $cat["titulo"]; ?></a></li>
  
  <?php } ?>

</ul>
</div>

<div style="margin-left:0px; margin-top:10px"><span>Voc&ecirc; est&aacute; em > <b><?=$dadosn1["titulo"]?></b></span></div>

 <div class="adv_categories" id="adv_categories"> 
 

<?php 

$bloquear	 	= 5;
$countcoluna 	= 0;
$limitcoluna 	= 3;
?>


<?
$dadosub			= $_cat->listan1("WHERE cat='".$categoria."' ","ORDER BY titulo","");
foreach($dadosub as $sub){?>
<? if($countcoluna == 0 || $countcoluna == $limitcoluna){?><div class="catcol  first"><? } ?>
<!-- catcol -->
<ul>
<li class="maincat cat-item-<?=$sub["id"]?>"><a href="#"><?=$sub["titulo"]?></a> (0)</li>
<?php 
$dadosub2 = $_cat->listan2("WHERE cat='".$categoria."' AND n1='".$sub["id"]."' ","ORDER BY titulo","");
$xd				= 1;
foreach($dadosub2 as $sub2){
?>
<? if($xd > $bloquear){ ?>

<li class="cat-item cat-item-<?=$sub2["id"]?>" id="somelista_<?=$sub["id"]?>" style=" display:none"><a href="#"><?=$sub2["titulo"]?></a> </li>

<? }else{ ?>
<li class="cat-item cat-item-<?=$sub2["id"]?>" ><a href="#"><?=$sub2["titulo"]?></a> </li>
<? } ?>

<? $xd++; } ?>

<? if($xd > $bloquear){ ?>

<li class="cat-item cat-item-<?=$sub2["id"]?>"><a href="javascript: void(0);" onClick="document.getElementById('somelista_<?=$sub["id"]?>').style.display=''"><b>Mais &raquo;</b></a> </li>
<? } ?>

</ul>
<!-- /catcol -->
<? if($countcoluna+1 == $limitcoluna){?></div><? $countcoluna= -1; } ?>


<? $countcoluna++; } ?>










 </div>
 <!-- /adv_categories --> 